<%@page import="com.neiquan.backstage.pub.bsc.dao.po.User"%>
<%@page import="com.neiquan.backstage.common.util.Sessions"%>
<%@page import="com.neiquan.backstage.common.util.SpringContextUtils"%>
<%@page import="com.neiquan.backstage.resourec_manage.EntrepreneurService"%>
<%@page import="org.springframework.context.ApplicationContext"%>
<%@page import="com.neiquan.backstage.common.CommonService"%>
<%@page import="com.neiquan.backstage.pub.bsc.dao.po.Entrepreneur"%>
<%@page import="java.util.List"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
 <% 
	ApplicationContext appCtx = SpringContextUtils.getApplicationContext();
	CommonService commonService = appCtx.getBean(CommonService.class);
	User loginedUser = (User) Sessions.getLoginedUser(session);
	String uniqueId=loginedUser.getEntrepreneurUniqueId();
	EntrepreneurService entrepreneurService = appCtx.getBean(EntrepreneurService.class);
	Integer memberId=loginedUser.getMemberId();
	Entrepreneur entrepreneur = entrepreneurService.queryByUniqueId(uniqueId, memberId);
	pageContext.setAttribute("entrepreneur", entrepreneur);
%> 
<!DOCTYPE html>
<html lang="zh-CN">
<head>
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
	<meta charset="UTF-8">
	<title>场地参观</title>
	<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=1.0" />
	<meta name="apple-mobile-web-app-capable" content="yes" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<link rel="stylesheet" href="css/base.css" />
	<link rel="stylesheet" href="css/main.css" />
</head>
<body bgcolor="#f0f0f0">
		<section class="mt activesignup">
			<section class="tc">
				<form id="addrvisitorform" class="fom">
					<section>
						<p class="addrvisitor-title pd">申请人信息</p>
						<section class="line"></section>
						<section class="common_bg">
							<section class="perfect pd">
							<p class="form-inpt-p">
								<label>公司名称</label><input readonly="readonly" placeholder="你的公司还没没审核通过" class="inpt" value="${pageScope.entrepreneur.name}" form="addrvisitorform" id="companyname" name="companyname" type="text" />
							</p>
							<p class="form-inpt-p">
								<label>联系人</label><input class="inpt" form="addrvisitorform" id="name" name="name" type="text" placeholder="请输入您的真实姓名" />
							</p>
							<p class="form-inpt-p">
								<label>手机号</label><input class="inpt" form="addrvisitorform" id="phone" name="phone" type="tel" placeholder="请输入您的手机号码" />
							</p>
							</section>
						</section>
					</section>
					<section class="mt">
						<p class="addrvisitor-title pd">参观信息</p>
						<section class="line"></section>
						<section class="common_bg">
							<section class="perfect pd">
							<p class="form-inpt-p">
								<label>参观人数</label><input class="inpt" form="addrvisitorform" id="peopleCount" name="peopleCount" type="text" placeholder="请输入参观人数" />
							</p>
							<p class="form-inpt-p">
								<label class="vistor-instuct">参观说明</label><textarea id="remark" name="remark"class="inpt vistor-instuct-text" form="addrvisitorform"  placeholder="请对您需要参观的地方、所需资源进行说明..." /></textarea>
							</p>
							</section>
						</section>
					</section>
					<input type="button" onClick="submit2()" class="btn fom-submit" value="提交申请">
				</form>
			</section>
		</section>
	</body>
		<script src="js/jquery.min.js"></script>
		<script src="js/main.js"></script>
		<script src="js/jquery.min.js"></script>		
		<script src="js/responsive.js"></script>
		<script type="text/javascript">
		function submit2(){
			var reqData={
					"entrepreneurId":'${pageScope.entrepreneur.entrepreneurId}',
					"phone":$("#phone").val(),
					"name":$("#name").val(),
					"peopleCount":$("#peopleCount").val(),
					"remark":$("#remark").val()
			}
			var url="api/sceneVisitReservation/add";
			$.post(url,reqData,function(data){
				alert("添加成功");
					window.location.href="myworkaddr.jsp";
			}); 
		}
		</script>
</html>
